<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<html lang="en">
    <head>
        <meta charset="utf-8">
         <meta charset="utf-8">
         <meta http-equiv="X-UA-Compatible" content="IE=11">
          <link rel="stylesheet" href="<%=basePath%>style/cssreset.css">
        
        <link rel="stylesheet" href="<%=basePath%>style/pagination.css">
        <link rel="stylesheet" href="<%=basePath%>style/style.css">
        <link rel="stylesheet" href="<%=basePath%>style/style2.css">
        <link rel="stylesheet" href="<%=basePath%>css/mycss.css"> 
        <link rel="stylesheet" href="<%=basePath%>css/mystyle.css"> 
        <script src="<%=basePath%>js/jquery.min.js"></script>
        <script src="<%=basePath%>js/jquery.pagination.js"></script>
           <script src="<%=basePath%>salejihui/My97DatePicker/WdatePicker.js"></script>
           <style type="text/css">
           .smallsa{
				width:100%;
				height:1062px;
				position:absolute;
				top:0px;
				left:0px;
				background:rgba(0,0,0,0.2);
				display:none;
			}
           	.apprcontent>table{
				border-top:1px solid #1fd4fb;
				width:100%;
			}
			thead{
				background:#ecf6f8;
			}
			tbody{
				background:#fff;
				font-size:14px;
			}
			td{
				padding:10px 15px;
				text-align:center;
				color:#555;
			}
			th{
				width: 100%;
			    height: 45px;
			    line-height: 45px;
			    background: #2f4050;
			    border-radius: 5px;
			    color: #fff;
			    font-size: 18px;
			    text-align: center;
			    margin-top: 0px;
			    position: relative;
			}
			.covers{
				background:#fff;
				width:100%;
				height:100%;
			}
			#cover3{
				display: none;
			    position: fixed;
			    z-index: 5;
			    top: 50%;
			    left: 50%;
			    margin-left:-292px;
			    margin-top:-293px;
			}
			input{
				float:none;
			}
           </style>	
        <script>
            $(function(){
			   /*  $(".more").click(function(e){
			    		$('body').css("overflow","hidden")
			        e.preventDefault();
			        $("#cover3").css("display","block");
			         $("#cover3").animate({
			            width: "100%",
			            height: "1800px",
			            top: "0",
			            left: "0"
			        },10); 
			        
			    }); */
			    $(".close").click(function(){
			    	$('body').css("overflow","scroll")
			        $("#cover3").removeAttr("style");
			        $("#cover-content2").removeAttr("style");
			    });
                $('.sh1').mouseover(function(event) {
                    $('.showhide1').css('display', 'block');
                });
                $('.sh1').mouseout(function(event) {
                    $('.showhide1').css('display', 'none');
                });
                $('.sh2').mouseover(function(event) {
                    $('.showhide2').css('display', 'block');
                });
                $('.sh2').mouseout(function(event) {
                    $('.showhide2').css('display', 'none');
                });
                $('.sh3').mouseover(function(event) {
                    $('.showhide3').css('display', 'block');
                });
                $('.sh3').mouseout(function(event) {
                    $('.showhide3').css('display', 'none');
                });
                $('.sh4').mouseover(function(event) {
                    $('.showhide4').css('display', 'block');
                });
                $('.sh4').mouseout(function(event) {
                    $('.showhide4').css('display', 'none');
                });
                
            })
        </script> 
       
    </head>
    <body>
    	<div class="bigbox xlbox">
    		<nav class="daohan">
                <ul>
                	<li class="sh1">
                        <a href="<%=basePath %>notice/findByAll.action"><p class="mline"><span class="smallicon" id="current1"></span><span class="navtxt">首页</span></p></a>  
                    </li>
                    <li>
                        <a href="<%=basePath %>client/qiangenzongcount.action?zhuizong=0"  ><p class="mline"><span class="smallicon" id="current11"></span><span class="navtxt"  >用户开发</span></p></a>
                    </li>
                    <li>
                        <a href="<%=basePath %>client/selectDepOrSta.action?start=1">
                            <p class="mline">
                                <span class="smallicon" id="ziji11"></span>
                                <span class="navtxt">代理开发</span>
                            </p>
                        </a>
                    </li>
                    <%-- <li class="sh2">
                        <a href="<%=basePath %>client/selectByStaffAnd.action?start=1"><p class="mline"><span class="smallicon one1"></span><span class="navtxt">客户资料</span><span class="ripic"></span></p></a>
                        <div class="showhide2">
                            <a href="<%=basePath %>client/selectByStaffAnd.action" style="font-size:14px;background:#435565;">
                             <p class="mline mline2">
                                <span class="smallicon" id="ziji3"></span>
                                <span class="navtxt" style="font-size: 14px;color:#929da8;">用户资料</span>
                             </p>
                             </a> 

                             <a href="<%=basePath %>client/selectByStaffAnd.action?start=1" style="font-size:14px;margin-top:-22px;background:#435565;">
                             <p class="mline mline2">
                                <span class="smallicon" id="ziji34"></span>
                                <span class="navtxt" id="current2" style="font-size: 14px;color:#929da8;">代理资料</span>
                             </p>
                             </a>    
                        </div>
                    </li> --%>
                    <li>
                        <a href="<%=basePath %>approve/count.action?pageSize=0" id="sline"><p class="mline"><span class="smallicon" id="ziji8"></span><span class="navtxt" id="current2">合同审批</span></p></a> 
                    </li>
                    <li>
                         <a href="<%=basePath%>page/pacts.jsp">
                             <p class="mline"><span class="smallicon one222"></span><span class="navtxt">审批详情</span></p>
                         </a>
                        
                    </li>
                    
                     <li>
                        <a href="<%=basePath %>Operate/count.action">
                             <p class="mline"><span class="smallicon" id="yunyin2"></span><span class="navtxt">运营管理</span></p>
                         </a>
                    </li>  
                    
                   <li>
                        <a href="#"><p class="mline"><span class="smallicon one3"></span><span class="navtxt">产品资源库</span></p></a>
                    </li>
                    <c:if test="${backstage == 1}">
                    	<li>
	                        <a href="<%=basePath %>client/findByAllGr.action"><p class="mline"><span class="smallicon one333"></span><span class="navtxt">后台管理</span></p></a>
	                    </li>
                    </c:if>
                </ul>
            </nav>
    		<div class="showbox">
                <h2>合 同 审 批<span class="exit"><span class="ex1">姓名:${staff.staff_name}</span>
					<a href="../login/tuichustaff.action" class="ex2"><span class="exicon2"></span>切换账号</a>
					<a href="../login/tuichustaff.action" class="ex3"><span class="exicon3"></span>退出账号</a>
				</span></h2>
                <div class="showbox2">
	    		
	    			<div class="aaa">
		    			<div class="smalltitle">
								<a href="<%=basePath%>approve/count.action?pageSize=0" style="width:70px;top:6px;margin-left:15px;"><span class="imgmove imgmove2"></span>未处理</a>
							<a href="<%=basePath%>approve/count.action?pageSize=1" class="light3" style="width:70px;top:6px;margin-left:12px;"><span class="imgmove imgmove2" style="top:5px;"></span>已处理</a>
							<a href="<%=basePath%>page/pacts.jsp" style="width:150px;top:6px;margin-left:15px;"><span class="imgmove imgmove2" style="top:2px;"><img src="../images/newshenpi.png" alt=""></span>&nbsp;&nbsp;新建审批表</a>	 			
		    				<form action="<%=basePath%>approve/count.action?pageSize=1" method="post" style="float:right;margin-right:220px;" onsubmit="return tims()">
			    				<input type="text" name="condition" value="${condition}" id="times" placeholder="单位名称、客户电话" style="width:200px;height:38px;border:1px solid #ccc;border-radius:5px;position:relative;top:6px;color:#ccc;font-family:'微软雅黑'">
								<input type="submit" value="搜索" style="width:60px;height:38px;position:relative;top:6px;border:none;text-align:center;border-radius:5px;margin-left:10px;cursor:pointer;background:#1fd4fb;color:#fff;">
							</form>
		    			</div>
	    				<ol class="htnav">
							<li class="changebg"><a href="<%=basePath%>approve/count.action?pageSize=1" style="color:#fff;">开户审批</a></li>	 
							<li><a href="<%=basePath%>audits/count.action?pageSize=1">合同审核</a></li>	 
	    				</ol>
	    				<div class="apprcontent">
    						<table>
    							<thead>
    								<tr>
    									<td>编码</td>
    									<td>单位名称</td>
    									<td>负责人</td>
    									<td>合同编号</td>
    									<td>客户电话</td>
    									<td>客服QQ</td>
    									<td>申请性质</td>
    									<td>合约比例</td>
    									<td>产品类别</td>
    									<td>招商经理</td>
    									<td>审批人</td>
    									<td>审批状态</td>
    								</tr>
    							</thead>
    							<tbody class="tbodys">
    								
    							</tbody>
    						</table>
    					</div>			
    				</div>
	    		<div class="M-box" style="margin-left:40%;"></div>
	    		</div>
	    		
					<!--  <div id="cover3">
						<div id="cover-bg3"></div>
						<form id="cover-content2">
							<h4>合 同 审 批 详 情<span class="close"></span></h4>
							<p class="main" style="margin-top:50px;">
								<span class="leftmain">提 交 时 间</span>
								<input type="text" class="shurukuang" id="saleStageName">
							</p>
							<p class="main">
								<span class="leftmain">合 同 编 号</span>
								<input type="text"  class="shurukuang" id="contractId">
							</p>
							<p class="main">
								<span class="leftmain">个 人 名 称</span>
								<input type="text"  class="shurukuang" id="username">
							</p>
	
							<p class="main">
								<span class="leftmain">保 证 金&nbsp;&nbsp;&nbsp;&nbsp;</span>
								<input type="text"  class="shurukuang" id="deposit">
							</p>
							<p class="main">
								<span class="leftmain">合 同 期 限</span>
								<input type="text"  class="shurukuang" id="contractTime">
							</p>
							<p class="main">
								<span class="leftmain">客 户 电 话</span>
								<input type="text"  class="shurukuang" id="clientelePhone">
							</p>
							<p class="main">
								<span class="leftmain">客 服 Q Q&nbsp;</span>
								<input type="text"  class="shurukuang" id="serviceQQ">
							</p>
							<p class="main">
								<span class="leftmain">现在办公地址</span>
								<input type="text"  class="shurukuang" style="width:255px;margin-left: 21px" id="workLocation">
							</p>
							<p class="main" style="height:100px;">
								<span class="leftmain" style="position:absolute;">合 同 内 容</span>
								<textarea name="" id="contractContent" class="shurukuang" style="height:100px;margin-left: 31%;" id="contractContent"></textarea>
							</p>
											
							<p class="main">
								<span class="leftmain">激 活 时 间</span>
								<input type="text"  class="shurukuang" id="activateTime">
							</p>
					        <p class="main">
								<span class="leftmain">申 请 性 质</span>
								<input type="text"  class="applyNature"  id="applyNature">
							</p>
							<p class="main">
								<span class="leftmain">合 作 单 位</span>
								<input type="text"  class="cooperator"  id="cooperator">
							</p>
							<p class="main">
								<span class="leftmain">合 约 比 例</span>
								<input type="text"  class="contractRate"  id="contractRate">
							</p>
							    <p class="main">
								<span class="leftmain">产 品 类 别</span>
								<input type="text"  class="pCategory"  id="pCategory" style="width:255px;">
							</p>
							<p class="main">
								<span class="leftmain">负 责 人</span>
								<input type="text"  class="rPerson"  id="rPerson" style="width:255px;">
							</p>
							<p class="main">
								<span class="leftmain">招 商 经 理</span>
								<input type="text"  class="imanager"  id="imanager">
							</p>
							<p class="main">
								<span class="leftmain">审 批 状 态</span>
								<input type="text"  class="shurukuang" id="approvalState">
							</p>
							<p class="main" style="height:100px;">
								<span class="leftmain" style="position:absolute;">审 批 意 见</span>
								<textarea name="" id="approveOpinion" class="shurukuang" style="height:100px;margin-left: 31%;border:1px solid #bfbfbf;background:#fff;"></textarea>
							</p>
							<p class="main" style="height:100px;padding-bottom:30px;">
								<span class="leftmain" style="position:absolute;">审 批 说 明</span>
								<textarea name="" id="remarks" class="shurukuang" style="height:100px;margin-left: 31%;border:1px solid #bfbfbf;background:#fff;"></textarea>
							</p>

						</form>
					 </div> -->
					 
					 
					 
					 
					 
					 <table id="cover3">
						<tr class="trs"><th colspan="4">合 同 审 批 详 情<span class="close"></span></th></tr>
						<tbody class="covers">
							<tr class="main">
								<td>提 交 时 间</td>
								<td><input type="text" class="shurukuang" id="saleStageName" disabled="disabled"></td>
								<td>合 同 编 号</td>
								<td><input type="text"  class="shurukuang" id="contractId" disabled="disabled"></td>
							</tr>
							<tr class="main">
								<td>申 请 名 称</td>
								<td><input type="text"  class="shurukuang" id="username" disabled="disabled"></td>
								<td>保 证 金</td>
								<td><input type="text"  class="shurukuang" id="deposit" disabled="disabled"></td>
							</tr>
							<tr class="main">
								<td>合 同 期 限</td>
								<td><input type="text"  class="shurukuang" id="contractTime" disabled="disabled"></td>
								<td>客 户 电 话</td>
								<td><input type="text"  class="shurukuang" id="clientelePhone" disabled="disabled"></td>
							</tr>
							<tr class="main">
								<td>客 服 Q Q</td>
								<td><input type="text"  class="shurukuang" id="serviceQQ" disabled="disabled"></td>
								<td>现在办公地址</td>
								<td><input type="text" id="workLocation"  class="shurukuang" disabled="disabled" ></td>
							</tr>
							<tr class="main">
								<td>合 同 内 容</td>
								<td><textarea name="" id="contractContent" class="shurukuang"  disabled="disabled" style="height:100px;"></textarea></td>
								<td>审 批 状 态</td>
								<td><input type="text"  class="shurukuang" id="approvalState" disabled="disabled"></td>
							</tr>
							<tr class="main">
								<td>激 活 时 间</td>
								<td><input type="text"  class="shurukuang" id="activateTime" disabled="disabled"></td>
								<td>申 请 性 质</td>
								<td><input type="text"  class="shurukuang"  id="applyNature" disabled="disabled"></td>
							</tr>
							<tr class="main">
								<td>合 作 单 位</td>
								<td><input type="text"  class="shurukuang"  id="cooperator" disabled="disabled"></td>
								<td>合 约 比 例</td>
								<td><input type="text"  class="shurukuang"  id="contractRate" disabled="disabled"></td>
							</tr>
							<tr class="main">
								<td>招 商 经 理</td>
								<td><input type="text"  class="shurukuang"  id="imanager" disabled="disabled"></td>
								<td>产 品 类 别</td>
								<td><input type="text"  class="shurukuang"  id="pCategory" disabled="disabled" ></td>
							</tr>
							<tr>
								<td>负 责 人</td>
								<td><input type="text"   id="rPerson"  class="shurukuang" disabled="disabled"></td>
								<td></td>
								<td></td>
							</tr>	
						</tbody>
					</table>
	    		</div>
	    		<div class="smallsa"></div>	
	    		
	    	</div>
	    	  	
	    <script type="text/javascript">
	    function tims(){	    	
	    	var val=true;
	    	if($("#times").val()==""){	    	
	    		alert("请输入起始时间!");
	    		return false;
	    	}
	    	return val;
	    }
	    $('.M-box').pagination({
	    	pageCount: ${PageCount},//总页数
			current: ${PageNum},//当前页码
		callback:function(api){
			var pageNum=api.getCurrent();
			  var condition="${condition}";
	        $.ajax({  
	            type : "POST",  
		            url : "<%=basePath%>approve/alreadyapproveAll.action",//路径  
		            data : {  
		            	pageNum : api.getCurrent(),
		            	"condition" : condition
		            },
		            success : function(data) {
		            	var number=data[0].number;//总页数
		            	api.setPageCount(number);//动态修改总页数为20页
		            	var pageNum=data[0].pageNum;
		            	var text="";
		            	$('.trs').remove();
		            	 
                      for(var i=0;i<data[0].list.length;i++){
                    	 
                    	  text=$('<tr class="trs"><td class="mores" onclick="dian('+data[0].list[i].approveId+')" style="cursor:pointer">'+data[0].list[i].approveId+'</td><td>'+data[0].list[i].cooperator+'</td>'
  								+'<td>'+data[0].list[i].rPerson+'</td><td>'+data[0].list[i].contractId+'</td><td>'+data[0].list[i].clientelePhone+'</td><td>'+data[0].list[i].serviceQQ+'</td><td>'+data[0].list[i].applyNature+'</td><td>'+data[0].list[i].contractRate+'</td>'
  								+'<td>'+data[0].list[i].pCategory+'</td><td>'+data[0].list[i].Imanager+'</td><td>'+data[0].list[i].approvalState+'</td></tr>');
                          $('.tbodys').append(text);
                          }
                      $(".trs:odd").css("background",'#f8f8f8');
		            }
		        });  
		    }
		},function(api){
		    var pageNum;
		    var condition="${condition}";
		    $.ajax({  
		        type : "POST",  
		        url : "<%=basePath%>approve/alreadyapproveAll.action",//路径  
		        data : {  
		        	pageNum : api.getCurrent(),
	            	"condition" : condition
		        },
		        success : function(data) {
		        	
		        	var number=data[0].number;//总页数
		        	api.setPageCount(number);//动态修改总页数为20页
		        	var pageNum=data[0].pageNum;
		        	var text="";  
                    for(var i=0;i<data[0].list.length;i++){
                    	text=$('<tr class="trs"><td class="mores" onclick="dian('+data[0].list[i].approveId+')" style="cursor:pointer">'+data[0].list[i].approveId+'</td><td>'+data[0].list[i].cooperator+'</td>'
								+'<td>'+data[0].list[i].rPerson+'</td><td>'+data[0].list[i].contractId+'</td><td>'+data[0].list[i].clientelePhone+'</td><td>'+data[0].list[i].serviceQQ+'</td><td>'+data[0].list[i].applyNature+'</td><td>'+data[0].list[i].contractRate+'</td>'
								+'<td>'+data[0].list[i].pCategory+'</td><td>'+data[0].list[i].Imanager+'</td><td>'+data[0].list[i].Approvers+'</td><td>'+data[0].list[i].approvalState+'</td></tr>');
                        $('.tbodys').append(text);
                          }    
                    $(".trs:odd").css("background",'#f8f8f8');
		        }
		    });
		   
		});
	    function dian(show){
			$("#cover3").css("display","block");
    		$(".smallsa").css("display","block");
    		$("body").css("overflow","hidden");
             $.ajax({
                 url: '<%=basePath %>approve/findContract.action',
                 type: 'post',
                 data: {approveId: show},
                 success:function(data){
                	 $('#saleStageName').val(data[0].saleStageName);//提 交 时 间
                	 $('#contractId').val(data[0].contractId);//合 同 编 号
                	 $('#username').val(data[0].username);//个 人 名 称
                
                	 $('#deposit').val(data[0].deposit);//保 证 金
                	 $('#contractTime').val(data[0].contractTime);//合 同 期 限
                	 $('#clientelePhone').val(data[0].clientelePhone);//客 户 电 话
                	 $('#serviceQQ').val(data[0].serviceQQ);//客 服 Q Q
                	 $('#workLocation').val(data[0].workLocation);//现在办公地址
                	  document.getElementById("contractContent").innerText=data[0].contractContent;//合 同 内 容
                	  $('#pCategory').val(data[0].pCategory);//产品类别
                      $('#rPerson').val(data[0].rPerson);//负责人
                	 $('#approvalState').val(data[0].approvalState);//审 批 状 态
                	 $('#activateTime').val(data[0].activateTime);//激 活 时 间

                	 document.getElementById("approveOpinion").innerText=data[0].approveOpinion;
                	 document.getElementById("remarks").innerText=data[0].remarks;              
                	 $('#cooperator').val(data[0].cooperator);///申请性质
                	 $('#contractRate').val(data[0].contractRate);//合作单位
                	 $('#imanager').val(data[0].imanager);//合约比例
                	 $('#clientelePhone').val(data[0].clientelePhone);//招商经理
                	 $('#applyNature').val(data[0].applyNature);
                 }
             })
             $("#cover3").css("display","block");
             $(".close").click(function(){
     	    	$('body').css("overflow","scroll");
     	    	$('body').css('overflow-x','hidden');
     	        $("#cover3").removeAttr("style");
     	        $("#cover-content2").removeAttr("style");
     	       $(".smallsa").css("display","none");
     	    });
         }
	    
</script>	 
    </body>
</html>
